package com.x_memteor.base_master.bean.request;

import android.text.TextUtils;

import com.x_memteor.base_master.base.BaseRequestEntity;
import com.x_memteor.base_master.utils.MD5Utils;

/**
 * @author: X_Meteor
 * @description: 类描述
 * @version: V_1.0.0
 * @date: 2018/3/18 9:20
 * @company:
 * @email: lx802315@163.com
 */
public class UpResistanceBody extends BaseRequestEntity {

    private String id;
    private String resistance;
    private String macid;
    private String token;
    private String sign;

    public String getToken() {
        return token;
    }

    public void setToken(String token) {
        this.token = token;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getResistance() {
        return resistance;
    }

    public void setResistance(String resistance) {
        this.resistance = resistance;
    }

    public String getMacid() {
        return macid;
    }

    public void setMacid(String macid) {
        this.macid = macid;
    }

    public void setSign(String sign) {
        this.sign = sign;
    }

    @Override
    public String getSign() {
        String sign = "";

        StringBuffer sb = new StringBuffer();
        sb.append("id=");
        sb.append(id);
        sb.append("&macid=");
        sb.append(macid);
        sb.append("&resistance=");
        sb.append(resistance);
        sb.append("&token=");
        sb.append(token);

        if (!TextUtils.isEmpty(sb)) {
            sign = MD5Utils.encryptMD5(sb.toString());
        }
        return sign;
    }

    @Override
    public String getCiphertext() {
        return null;
    }
}
